﻿using System;
using System.Collections.Generic;
using System.Runtime.CompilerServices;
using Way.Bus.WMS.Model;
using Way.EAP.DataAccess.Entity;
using System.Drawing;
namespace Way.Bus.WMS.ST.Model
{
    public class ST_OutNotice : StockOutNotice, IPropertyValueType
    {
        public ST_OutNotice[] OutNotice()
        {
            return null;
        }
        public PropertyValueType[] GetValueType(ValueTypeArgs valueArgs)
        {
            string tn = this.ToString();
            PropertyValueType type2;
            List<PropertyValueType> list = new List<PropertyValueType>();
            if (valueArgs.ColumnName == "ReceiptState" && valueArgs.TableName == tn)
            {
                PropertyValueType item = new PropertyValueType
                {
                    Text = "未签收",
                    Value = "0"
                };
                type2 = new PropertyValueType
                {
                    Text = "已签收",
                    Value = "1"
                };
                list.Add(item);
                list.Add(type2);
            }
            if (valueArgs.ColumnName == "STATE" && valueArgs.TableName == tn)
            {
                type2 = new PropertyValueType
                {
                    Value = "0",
                    Text = "未出库"
                };
                PropertyValueType type3 = new PropertyValueType
                {
                    Value = "1",
                    Text = "部分出库"
                };
                PropertyValueType type4 = new PropertyValueType
                {
                    Value = "2",
                    Text = "出库完成"
                };
                PropertyValueType type5 = new PropertyValueType
                {
                    Value = "3",
                    Text = "已装车"
                };
                PropertyValueType type6 = new PropertyValueType
                {
                    Value = "4",
                    Text = "已卸货"
                };
                list.Add(type2);
                list.Add(type3);
                list.Add(type4);
                list.Add(type5);
                list.Add(type6);
            }
            return list.ToArray();
        }

        [EntityField(10), EntityControl("打印次数", true, true, 4)]
        public int NoticePrintNum { get; set; }

        [EntityField(1), EntityControl("打印状态", true, true, 0x13)]
        public bool NoticePrintState { get; set; }

        [EntityControl("发货时间", false, true, 8), EntityField(0xff)]
        public DateTime OutTime { get; set; }

        [EntityControl("运输单ID", false, false, 6), EntityField(10), EntityForeignKey(typeof(ST_PackList), "ID", "Code")]
        public int PackID { get; set; }

        [EntityField(500, IsNotNullable = true), EntityControl("收货地址", false, true, 9)]
        public string ReceiptAddress { get; set; }

        [EntityControl("签收单号", true, false, 4), EntityField(20)]
        public string ReceiptCode { get; set; }

        [EntityField(200, IsNotNullable = false), EntityControl("供货客户联系人", false, true, 4), EntityForeignKey(typeof(ST_CustomerAdress), "ID", "LXRName")]
        public string ClientContactPerson { get; set; }

        [EntityField(12, IsNotNullable = false), EntityControl("供货客户联系人电话", false, true, 4)]
        public string ClientPhoneCode { get; set; }

        [EntityField(0xff), EntityControl("签收日期", false, false, 8)]
        public DateTime ReceiptDate { get; set; }

        [EntityControl("收货客户", false, true, 9), EntityField(200)]
        public string ReceiptClient { get; set; }

        [EntityControl("收货人", false, true, 10), EntityField(50, IsNotNullable = true)]
        public string ReceiptPerson { get; set; }

        [EntityField(12, IsNotNullable = true), EntityControl("收货人电话", false, true, 4)]
        public string ReceiptPhoneCode { get; set; }

        [EntityControl("打印次数", true, false, 4), EntityField(10)]
        public int ReceiptPrintNum { get; set; }

        [EntityField(1), EntityControl("打印状态", true, false, 0x13)]
        public bool ReceiptPrintState { get; set; }

        [EntityField(0xff), ValueTypeProperty, EntityControl("状态", false, false, 6)]
        public int ReceiptState { get; set; }

        [EntityField(200), EntityControl("送货人", false, false, 9)]
        public string SendPerson { get; set; }

        [EntityField(200), EntityControl("运单号", false, false, 9)]
        public string waybill { get; set; }

        [EntityField(0xff), EntityControl("物流公司", false, false, 4), EntityForeignKey(typeof(ST_Customer), "ID", "CUSTOMERNAME")]
        public string wlgs { get; set; }

        //public Image ReceiptImage { get; set; }
    }
}

